//
//  CollectionViewCellOfFour.m
//  22-ALiStar
//
//  Created by Snow on 16/8/15.
//  Copyright © 2016年 Snow. All rights reserved.
//

#import "CollectionViewCellOfFour.h"
#define kWidth self.frame.size.width
#define kHeight self.frame.size.height

@implementation CollectionViewCellOfFour
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        _labelOfTitle = [[UILabel alloc] init];
        _labelOfContent = [[UILabel alloc] init];
        _image = [[UIImageView alloc] init];
        [self.contentView addSubview:_labelOfTitle];
        [self.contentView addSubview:_labelOfContent];
        [self.contentView addSubview:_image];
    }
    return self;
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    [super applyLayoutAttributes:layoutAttributes];
    _image.frame = CGRectMake(0, 0, kWidth / 3, kHeight);
    _labelOfTitle.frame = CGRectMake(kWidth / 3, 10, kWidth, kHeight / 5);
    _labelOfContent.frame = CGRectMake(kWidth / 3, kHeight / 5 + 15, kWidth, kHeight / 3);
    _labelOfContent.font = [UIFont systemFontOfSize:12];
}

@end
